FROM openjdk:21-jdk
#FROM openjdk:21-jdk-slim

# 设置语言
ENV LANG en_US.UTF-8
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8

# 设置地理位置
ENV TZ=Asia/Shanghai

# 设置时区
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

# 解决绘制图形验证码报错问题
#RUN #yum install dejavu-sans-fonts fontconfig -y

# 挂在目录
VOLUME /data

COPY ./api-gateway/target/api-gateway.jar api-gateway.jar
COPY ./apisvc-scms/target/apisvc-scms.jar apisvc-scms.jar
COPY ./microsvc-user/user-svc/target/microsvc-user.jar microsvc-user.jar
COPY ./microsvc-task/task-svc/target/microsvc-task.jar microsvc-task.jar

RUN echo "#!/bin/bash" > /run.sh
RUN echo "java -jar api-gateway.jar  \
      & java -jar apisvc-scms.jar  \
      & java -jar microsvc-user.jar  \
      & java -jar microsvc-task.jar \
    " >> /run.sh

RUN chmod +x /run.sh

# 设置容器启动时执行的命令
ENTRYPOINT ["/run.sh"]
